package vlc.ui;

import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.awt.Dimension;

@SuppressWarnings("serial")
public class Main extends JFrame  {
	

private final HeadInterface head;
private final CenterInterface center;
private final BottomInterface bottom;
	Main(String title, String[] expressions) {
		super(title);
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		BorderLayout b=new BorderLayout();
		setLayout(b);
		head=new HeadInterface(this);
		center= new CenterInterface();
		bottom= new BottomInterface();
		add(head,BorderLayout.NORTH);
		add(center,BorderLayout.CENTER);
		add(bottom,BorderLayout.SOUTH);
		setMinimumSize(new Dimension(550, 105));
		pack();

	}
public void hidePlaylist(){
	setMinimumSize(new Dimension(550, 105));
	center.setVisible(false);
	bottom.setVisible(false);
	head.setSize(head.fullvisible());
	pack();
}
public void showPlaylist(){
	Dimension dim_head= getLayout().preferredLayoutSize(head);
	Dimension dim_bottom= getLayout().preferredLayoutSize(bottom);
	Dimension d =new Dimension(dim_head.width,dim_bottom.height+dim_head.height);
	setMinimumSize(new Dimension(d.width+10, d.height));	
	center.setVisible(true);
	bottom.setVisible(true);
}

	public static void main(String[] argv) {
		final String[] expressions = argv;
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				new Main("My VLC", expressions).setVisible(true);
			}
		});
	}
}